﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows;
using SongSharp.Appliance;
using SongSharp.Presentation.View;
using SongSharp.Presentation.Command;

namespace SongSharp.Presentation.ViewModel
{
    public class ErrorViewModel : ViewModelBase
    {
        private ErrorView ErrorView { get; set; }

        public ErrorViewModel()
        {

        }

        public void ShowWindow(string errorMessage)
        {
            if (ErrorView == null || !ErrorView.IsLoaded)
            {
                ErrorView = new ErrorView();
                ErrorView.DataContext = this;
                ErrorView.Show();
            }
            else
            {
                ErrorView.Activate();
            }

            ErrorView.SetErrorMessage(errorMessage);
        }
    }
}
